package tech.aistar.corejava.day02;

/**
 * @author success
 * @version 1.0
 * @description:本类用来演示:练习:奶茶的单价10.0元,每买第二杯半价.如果买了5杯,结果是40
 * @date 2019/7/16 0016
 */
public class IfElseDemo {
    public static void main(String[] args) {
        //1. 偶数

        //编程从变量开始
        double money = 10.0D;
        int cup = 4;

        //2. 定义一个变量用来保存总价
        double total = money*(cup/2)+(money/2)*(cup/2);

        //3. 判断是否带上电灯泡
        if(cup % 2 !=0){
            //total = total + money;
            total += money;
        }
        System.out.println("total:"+total);
    }
}
